import request from '@/utils/request'


// 1.10.1 域名列表查询 
// 查询域名信息列表
export function listDomain(query) {
  return request({
    url: '/system/domain/list',
    method: 'get',
    params: query
  })
}

// 查询域名信息详细
export function getDomain(id) {
  return request({
    url: '/system/domain/' + id,
    method: 'get'
  })
}

// 新增域名信息
export function addDomain(data) {
  return request({
    url: '/system/domain',
    method: 'post',
    data: data
  })
}

// 修改域名信息
export function updateDomain(data) {
  return request({
    url: '/system/domain',
    method: 'put',
    data: data
  })
}

// 删除域名信息
export function delDomain(id) {
  return request({
    url: '/system/domain/' + id,
    method: 'delete'
  })
}



// 1.10.2 单个域名添加标签保存{	"domainId":1,	"labelIdList":[104532]}
export function domainlabelAddList(data) {
  return request({
    url: '/system/domainlabel/addList',
    method: 'post',
    data
  })
}

// 1.10.3 批量域名添加标签保存 {	"domainIdList":[1,2],	"labelIdList":[104532,104531,104534]}
export function domainlabelBatchAddList(data) {
  return request({
    url: '/system/domainlabel/batchAddList',
    method: 'post',
    data: data
  })
}

// 1.10.4 批量删除标签
export function domainlabelBatchDeleteList(data) {
  return request({
    url: '/system/domainlabel/batchDeleteList',
    method: 'post',
    data: data
  })
}

// 1.10.5 域名标签回显 {domainId}
export function domainSelectLabelByDomainId(data) {
  return request({
    url: '/system/domain/selectLabelByDomainId',
    method: 'get',
    data: data
  })
}


// 1.10.6 域名批量审核 { "auditStatus": 1, "domainIdList": [1, 2] }
export function batchDomainCheck(data) {
  return request({
    url: '/system/domain/batchDomainCheck',
    method: 'post',
    data: data
  })
}

// 1.10.7 批量备注 {domainIdList:[],remark:''}
export function batchDomainRemark(data) {
  return request({
    url: '/system/domain/batchDomainRemark',
    method: 'post',
    data: data
  })
}
// 1.10.8 批量回源 {	"sourceStatus":1,	"domainIdList":[1,2]}
export function batchDomainSource(data) {
  return request({
    url: '/system/domain/batchDomainSource',
    method: 'post',
    data: data
  })
}

// 1.10.9 概览信息
export function getDomainOverview(id) {
  return request({
    url: '/system/domain/getDomainOverview?id=' + id,
    method: 'get'
  })
}
// 1.10.10 域名审核 {id,auditStatus}
export function domainCheck(data) {
  return request({
    url: '/system/domain/domainCheck',
    method: 'post',
    data: data
  })
}

// 1.10.10 是否自动替换异常ip请求类型：Post muti  url:/system/domain/domainIpReplace
export function domainIpReplace(data) {
  return request({
    url: '/system/domain/domainIpReplace',
    method: 'post',
    data: data
  })
}

// 1.10.13 查询分配的Ip
export function getAssignIPList(data) {
  return request({
    url: '/system/domainip/getAssignIPList',
    method: 'get',
    params: data
  })
}

// 1.10.14 重新调度分配ip

export function domainAssignIP(data) {
  return request({
    url: '/system/domain/assignIP',
    method: 'post',
    data
  })
}

// 1.10.15 手动分配Ip搜索


export function domainGetIpList(data) {
  return request({
    url: '/system/domain/getIpList',
    method: 'post',
    data
  })
}
// 1.10.16 域名手动分配Ip
// 请求类型：post json
export function domainManualAssign(data) {
  return request({
    url: '/system/domain/manualAssign',
    method: 'post',
    data
  })
}

// 1.10.17 逻辑删除关联的ip
// 请求类型：post multi
export function domainipDelete(data) {
  return request({
    url: '/system/domainip/delete',
    method: 'post',
    data
  })
}

// 1.10.18 撤销删除关联的ip
// 请求类型：post multi
export function domainipRevertDelete(data) {
  return request({
    url: '/system/domainip/revertDelete',
    method: 'post',
    data
  })
}

// 1.10.19 Ip底层同步
// 请求类型：post multi
export function synchronizationIp(data) {
  return request({
    url: '/system/domain/synchronizationIp',
    method: 'post',
    headers:{'content-type':'application/x-www-form-urlencoded;charset=utf-8' },
    data
  })
}


// 1.10.11选择cname后缀列表
// 请求类型：get multi
export function getAllPrefix(data) {
  return request({
    url: '/system/prefix/getAllPrefix',
    method: 'get',
    params: data
  })
}

// 1.10.12 保存cname后缀
// 请求类型：post multi
// url: system/domain/addCnamePrefix
export function addCnamePrefix(data) {
  return request({
    url: '/system/domain/addCnamePrefix',
    method: 'post',
    data
  })
}
export function getHomeDomainStatistics(data) {
  return request({
    url: '/system/home/getHomeDomainStatistics',
    method: 'get',
    params: data
  })
}
